package jmcnet.libcommun.utilit;

import jmcnet.libcommun.exception.TimeException;

public class TimeHHMM extends Time {
	public TimeHHMM(int hh, int mm) {
		super(hh, mm, 0, 0);
	}

	public TimeHHMM(int hh) {
		super(hh, 0, 0, 0);
	}

	public TimeHHMM() {
		super(0, 0, 0, 0);
	}
	
	public TimeHHMM(Time t) {
		super(t.getHour(), t.getMinute(), 0, 0);
	}

	@Override
	public String toString() {
		return timeToString(true, true, false, false);
	}

	public static TimeHHMM stringToTimeHHMM(String str, boolean hb,
			boolean mb) throws TimeException {
		if (str == null || str.length() <= 0) {
			return null;
		}
		Time t = Time.stringToTime(str, hb, mb, false, false);
		return new TimeHHMM(t.getHour(), t.getMinute());
	}
}
